<template>
    <view class="setUp">
        <Navigation backType="back" title="设置" background="#fff" />
        <view class="bg ph-40">
            <view class="f ai-c h-112 jc-s-b list w-f" @click="toSecure">
                <view class="fs-32 text-color4">账号与安全</view>
                <u-icon name="arrow-right" color="#CCCCCC" size="13"></u-icon>
            </view>
            <view class="f ai-c h-112 jc-s-b list w-f" @click="toAbout">
                <view class="fs-32 text-color4">隐私设置</view>
                <u-icon name="arrow-right" color="#CCCCCC" size="13"></u-icon>
            </view>
            <view class="f ai-c h-112 jc-s-b list w-f" @click="toMyAddress">
                <view class="fs-32 text-color4">地址管理</view>
                <u-icon name="arrow-right" color="#CCCCCC" size="13"></u-icon>
            </view>
        </view>
        <view class="bg ph-40 mt-20">
            <view class="f ai-c h-112 jc-s-b list w-f"  @click="toMyMessage">
                <view class="fs-32 text-color4">消息管理</view>
                <u-icon name="arrow-right" color="#CCCCCC" size="13"></u-icon>
            </view>
            <view class="f ai-c h-112 jc-s-b list w-f" @click="clear">
                <view class="fs-32 text-color4">清除缓存</view>
                <view class="f ai-c">
                    <view class="mr-20 fs-28 text-color3"> 0M</view>
                    <u-icon name="arrow-right" color="#CCCCCC" size="13"></u-icon>
                </view>
            </view>
        </view>
        <view class="bg ph-40 mt-20" @click="toAboutUs">
            <view class="f ai-c h-112 jc-s-b list w-f">
                <view class="fs-32 text-color4">关于我们</view>
                <u-icon name="arrow-right" color="#CCCCCC" size="13"></u-icon>
            </view>
        </view>
        <view class="bg ph-40 mt-20">
            <view class="f ai-c h-112 jc-c w-f fs-36 fw-500 text-color" @click="loginOutTap"> 退出登陆 </view>
        </view>
    </view>
</template>
<script setup lang="ts">
	import { useAuthStore } from '@/store/modules/auth';
	const authStore = useAuthStore();
	function loginOutTap(){
		uni.showModal({
			title: '提示',
			content: '确定退出登录？',
			success: function (res) {
				if (res.confirm) {
					authStore.loginOut()
				} 
			}
		});
		
	}
function clear() {
   uni.showToast({
       title: '清除成功',
   });
}
function toAbout() {
    uni.navigateTo({
        url: '/pages_mine/about',
    });
}
function toAboutUs() {
    uni.navigateTo({
        url: '/pages_mine/about',
    });
}
function toMyMessage() {
    uni.navigateTo({
        url: '/pages_mine/myMessage',
    });
}
function toMyAddress() {
    uni.navigateTo({
        url: '/pages_mine/myAddress',
    });
}
function toSecure() {
    uni.navigateTo({
        url: '/pages_mine/secure',
    });
}
</script>
<style lang="scss" scoped>
.setUp {
    background: #f5f5f5;
    min-height: 100vh;
    .list {
        border-bottom: 1px solid #f5f5f5;
    }
    .bg {
        background: #fff;
    }
}
</style>
